package cn.edu.sdjzu.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
    @GetMapping("/hello")
    @SentinelResource(value = "hello", blockHandler = "blockHello")
    public String hello() {
        return "Hello World! sentinel 9033";
    }

    public String blockHello(BlockException e) {
        return "杨磊：系统繁忙，限流了！";
    }
}
